package com.example.allplan.SQhelper;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import android.widget.Toast;

import androidx.annotation.Nullable;

public class SuoYouJiHuaBaoSQhelper extends SQLiteOpenHelper {
    final String CHUANG_JIAN_JI_HUA_BAO_BIAO="create table ji_hua_bao_biao(id int primary key,pai_xu_you_biao int,biao_qing_fu_hao_zhi int,lei_xing int,ji_hua_shu int,bao_ming varchar(15))";
    final String TIAN_JIA_MO_REN_BAO="insert into ji_hua_bao_biao(id,pai_xu_you_biao,biao_qing_fu_hao_zhi,lei_xing,ji_hua_shu,bao_ming) values(0,-1,127968,0,0,\"默认分组\")";
    final String TIAN_JIA_HUI_SHOU_ZHAN="insert into ji_hua_bao_biao(id,pai_xu_you_biao,biao_qing_fu_hao_zhi,lei_xing,ji_hua_shu,bao_ming) values(1,2147483647,128683,2,0,\"回收站\")";
    Context mCON;
    public SuoYouJiHuaBaoSQhelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
        mCON=context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CHUANG_JIAN_JI_HUA_BAO_BIAO);
        db.execSQL(TIAN_JIA_MO_REN_BAO);
        db.execSQL(TIAN_JIA_HUI_SHOU_ZHAN);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
